// ValidationAspects
// Written by Mike Saunders
// Released under Microsoft Public License (Ms-PL)
using System;

namespace ValidationAspects.Sdk
{
	public class InlineValidatorFactory<TValue> : ValidatorFactoryBase<TValue>
	{
		private readonly Action<TValue, IValidationContext> _validateAction;

		public InlineValidatorFactory(Action<TValue, IValidationContext> validateAction)
		{
			Enforce.IsNotNull(validateAction, "validateAction");
			_validateAction = validateAction;
		}

		#region Overrides of ValidatorFactoryBase<TValue>
		protected override Action<TValue, IValidationContext> ValidateAction
		{
			get { return _validateAction; }
		}
		#endregion
	}
}